﻿using Wizard.Runtime;

namespace Wizard.Functions
{
    using Wizard.Runtime;

    public abstract class OneParam<Param1Type, ResultType> : Function<ResultType>
    {
        protected readonly IHasValue<Param1Type> mParam1;

        protected OneParam(string name, FunctionType type, IHasValue<Param1Type> param1)
            : base(name, type)
        {
            mParam1 = param1;
            mParam1.ValueChanged += OnParamChanged;
        }

        protected virtual void OnParamChanged(object sender, IValueChangedEventArgs e)
        {
            base.SetModified(sender, e);
        }
    }
}